﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using RemoteController;

namespace VisualRemoteController
{
    public class PartyMacroCommandGetterO:PartyMacroCommandGetter
    {
        MacroCommand On;
        MacroCommand Off;

       public PartyMacroCommandGetterO(Light light, Stereo stereo, CeilingFan fan, GUICommandDecoratorStrategy[] GS):base(light,stereo,fan)
       {
           for (int i = 0; i < commandsON.Length; i++)
           {
               commandsON[i] = new GUICommandDecorator(commandsON[i], GS[i]);
               commandsOFF[i] = new GUICommandDecorator(commandsOFF[i], GS[i]);
               //commandsOFF[commandsON.Length - i - 1] = new GUICommandDecorator(commandsOFF[commandsON.Length - i - 1], GS[commandsON.Length - i - 1]);
           }

           /*for (int i = commandsON.Length - 1;i>=0;i--)
           {
               commandsOFF[i] = new GUICommandDecorator(commandsOFF[i], GS[i]);
           }*/


           On = new MacroCommand(commandsON);
           Off = new MacroCommand(commandsOFF);           
       }

       public override MacroCommand getOnMacro()
       {
           return On;
       }

       public override MacroCommand getOffMacro()
       {
           return Off;
       }
    }
}